package cn.caskm.souvenirshopsystem.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Collections;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageDTO<D> {

    private List<D> list;

    private Long pages;

    private Long total;

    public static <D> PageDTO<D> empty() {
        return new PageDTO<>(Collections.emptyList(), 0L, 0L);
    }

    public static <D> PageDTO<D> of(List<D> list, Long pages, Long total) {
        return new PageDTO<>(list, pages, total);
    }

}
